package jnpf.constant.model;

import jnpf.i18n.util.I18nUtil;
import lombok.Data;

/**
 * 类功能
 *
 * @date 2021/12/20
 */
@Data
public class MCode {

    /**
     * 提示信息类型
     */
    private final String type;

    /**
     * 错误编码
     */
    private final String code;

    /**
     * description 描述
     */
    private final String desc;


    public MCode(String type, String code, String desc){
        this.type = type;
        this.code = code;
        this.desc = desc;
    }

    public String get(Object... args){
        return I18nUtil.getMessageStr(this, args);
    }

    public String getMsg(){
        return type + ":" + code + " " + desc;
    }

}
